home *** CD-ROM | disk | FTP | other *** search
/ Aminet 44 / Aminet 44 (2001)(GTI - Schatztruhe)[!][Aug 2001].iso / Aminet / game / patch / WHDIGamesA-B.lzh / BobsGarden.lha / BobsGardenHD / Install < prev    next >
Text File  |  2001-04-26  |  4KB  |  212 lines

  1. ;****************************
  2.  
  3. (set #sub-dir "")            ;sub directory containing data files
  4. (set #readme-file "ReadMe")        ;name of readme file
  5. (set #highs-file "BobsGarden.highs")    ;name of high scores file
  6. (set #cleanup "")            ;files to delete after install
  7.  
  8. ;****************************
  9. ;----------------------------
  10. ; checks if given program is installed, if not abort install
  11. ; #program - to check
  12.  
  13. (procedure P_ChkRun
  14.   (if
  15.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  16.     ("")
  17.     (abort
  18.       (cat
  19.     "You must install \"" #program "\" first!\n"
  20.     "It must be accessible via the path.\n"
  21.     "You can find it in the WHDLoad package."
  22.       )
  23.     )
  24.   )
  25. )
  26.  
  27. (procedure P_ChkRunAminet
  28.   (if
  29.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  30.     ("")
  31.     (abort
  32.       (cat
  33.     "You must install \"" #program "\" first!\n"
  34.     "It must be accessible via the path.\n"
  35.     "You can find it on Aminet."
  36.       )
  37.     )
  38.   )
  39. )
  40.  
  41. ;----------------------------
  42. ; Wait for inserting disk
  43. ; IN:  #AD_disk - name of disk
  44. ; OUT: -
  45.  
  46. (procedure P_disk
  47.   (askdisk
  48.     (dest #AD_disk)
  49.     (prompt ("\nInsert Disk \"%s\" in any drive!" #AD_disk))
  50.     (help @askdisk-help)
  51.   )
  52. )
  53.  
  54. ;****************************
  55.  
  56. (if
  57.   (exists #readme-file)
  58.   (if
  59.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  60.     ("")
  61.     (run ("SYS:Utilities/More %s" #readme-file))
  62.   )
  63. )
  64.  
  65. (set #program "WHDLoad")
  66. (P_ChkRun)
  67.  
  68. (set #program "xfddecrunch")
  69. (P_ChkRunAminet)
  70.  
  71. (set @default-dest
  72.   (askdir
  73.     (prompt ("Where should \"%s\" be installed?\nA drawer \"%s\" will be automatically created." @app-name @app-name))
  74.     (help @askdir-help)
  75.     (default @default-dest)
  76.     (disk)
  77.   )
  78. )
  79. (set #dest (tackon @default-dest @app-name))
  80. (if
  81.   (exists #dest)
  82.   (
  83.     (set #choice
  84.       (askbool
  85.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted?" #dest))
  86.         (default 1)
  87.         (choices "Delete" "Skip")
  88.         (help @askbool-help)
  89.       )
  90.     )
  91.     (if
  92.       (= #choice 1)
  93.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  94.     )
  95.   )
  96. )
  97. (makedir #dest
  98.   (help @makedir-help)
  99.   (infos)
  100. )
  101.  
  102. ;----------------------------
  103.  
  104. (copyfiles
  105.   (help @copyfiles-help)
  106.   (source ("%s.Slave" @app-name))
  107.   (dest #dest)
  108. )
  109. (if
  110.   (exists ("%s.newicon" @app-name))
  111.   (set #icon
  112.     (askchoice
  113.       (prompt "\nWhich icon would you like to install?\n")
  114.       (default 0)
  115.       (choices "Normal" "NewIcon" "GlowIcon")
  116.       (help @askchoice-help)
  117.     )
  118.   )
  119.   (set #icon 0)
  120. )
  121. (select #icon
  122.   (set #icon ("%s.inf" @app-name))
  123.   (set #icon ("%s.newicon" @app-name))
  124.   (set #icon ("%s.glowicon" @app-name))
  125. )
  126. (copyfiles
  127.   (help @copyfiles-help)
  128.   (source #icon)
  129.   (newname ("%s.info" @app-name))
  130.   (dest #dest)
  131. )
  132. (tooltype
  133.   (dest (tackon #dest @app-name))
  134.   (settooltype "Slave" ("%s.Slave" @app-name))
  135.   (setdefaulttool "WHDLoad")
  136.   (setstack 10240)
  137.   (noposition)
  138. )
  139. (if
  140.   (exists #readme-file)
  141.   (copyfiles
  142.     (help @copyfiles-help)
  143.     (source #readme-file)
  144.     (dest #dest)
  145.   )
  146. )
  147. (if
  148.   (exists ("%s.info" #readme-file))
  149.   (
  150.     (copyfiles
  151.       (help @copyfiles-help)
  152.       (source ("%s.info" #readme-file))
  153.       (dest #dest)
  154.     )
  155.     (tooltype
  156.       (dest (tackon #dest #readme-file))
  157.       (noposition)
  158.     )
  159.   )
  160. )
  161. (if
  162.   (exists ("%s.info" #readme-file))
  163.   (
  164.     (copyfiles
  165.       (help @copyfiles-help)
  166.       (source ("%s.info" #readme-file))
  167.       (dest #dest)
  168.       (newname "BobsGarden.doc.info")
  169.     )
  170.     (tooltype
  171.       (dest (tackon #dest "BobsGarden.doc.info"))
  172.       (noposition)
  173.     )
  174.   )
  175. )
  176.  
  177. (if
  178.   (= #sub-dir "")
  179.   ("")
  180.   (
  181.     (set #dest (tackon #dest #sub-dir))
  182.     (makedir #dest
  183.       (help @makedir-help)
  184.     )
  185.   )
  186. )
  187. (if
  188.   (exists #highs-file)
  189.   (copyfiles
  190.     (help @copyfiles-help)
  191.     (source #highs-file)
  192.     (dest #dest)
  193.   )
  194. )
  195.  
  196. ;----------------------------
  197.  
  198. (set #AD_disk "CompiledVol.13")
  199. (P_disk)
  200. (copyfiles
  201.   (help @copyfiles-help)
  202.   (source ("%s:BobsGarden/" #AD_disk))
  203.   (dest #dest)
  204.   (pattern "(BobsGarden|BobsGarden.doc)")
  205. )
  206.  
  207. ;----------------------------
  208.  
  209. (run ("Delete %s ALL QUIET FORCE" #cleanup))
  210.  
  211. (exit)
  212.